package Form;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.SystemColor;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.BevelBorder;
import javax.swing.border.MatteBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

import Control.CommonControls;
import Control.Workshop_WorkshopMain_Controller;

@SuppressWarnings("serial")
public class Main extends JFrame {
	
	public static Main frame = null;
	static JTabbedPane tabs = null;
	private JPanel progress;
	private JLabel lblLeaseWait;
	private JProgressBar progressBar;
	private int progressBarCalls = 0;
	private JTextField txtKeywords;
	private JButton btnSearch;
	Shop_Product_Search_Form spsf;
	
	public static void main(){
		
		Main frame = new Main();
		frame.setVisible(true);
		
		//Dynamically set size
		frame.pack();
		frame.setSize(frame.getWidth(), frame.getHeight());
		
		//Set this to middle
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		
		//Startup functions
		Workshop_WorkshopMain_Controller.checkWorkshopStatus();
	}
	
	public Main(){
		
		//Set Look and Feel
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		//Create window
		frame = this;
		this.setTitle("Main Page");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel contentPane = new JPanel();
		this.setContentPane(contentPane);
		GridBagLayout gbl_contentPane = new GridBagLayout();
		gbl_contentPane.columnWidths = new int[] {450, 0, 600, 0};
		gbl_contentPane.rowHeights = new int[] {610, 10, 20};
		gbl_contentPane.columnWeights = new double[]{1.0, 0.0, 1.0, Double.MIN_VALUE};
		gbl_contentPane.rowWeights = new double[]{1.0, 0.0, 0.0};
		contentPane.setLayout(gbl_contentPane);
		
		JSeparator separator = new JSeparator();
		separator.setForeground(Color.LIGHT_GRAY);
		separator.setOrientation(SwingConstants.VERTICAL);
		GridBagConstraints gbc_separator = new GridBagConstraints();
		gbc_separator.fill = GridBagConstraints.BOTH;
		gbc_separator.insets = new Insets(10, 10, 5, 10);
		gbc_separator.gridx = 1;
		gbc_separator.gridy = 0;
		contentPane.add(separator, gbc_separator);
		
		tabs = new JTabbedPane(JTabbedPane.TOP);
		GridBagConstraints gbc_tabs = new GridBagConstraints();
		gbc_tabs.insets = new Insets(10, 0, 5, 0);
		gbc_tabs.fill = GridBagConstraints.BOTH;
		gbc_tabs.gridx = 2;
		gbc_tabs.gridy = 0;
		contentPane.add(tabs, gbc_tabs);

		JPanel navigations = new JPanel();
		GridBagConstraints gbc_navigations = new GridBagConstraints();
		gbc_navigations.insets = new Insets(10, 5, 5, 5);
		gbc_navigations.fill = GridBagConstraints.BOTH;
		gbc_navigations.gridx = 0;
		gbc_navigations.gridy = 0;
		contentPane.add(navigations, gbc_navigations);
		navigations.setLayout(new CardLayout());
		
		JPanel customerNavigation = new JPanel();
		navigations.add(customerNavigation, "CUSTOMER_NAVIGATION");
		GridBagLayout gbl_customerNavigation = new GridBagLayout();
		gbl_customerNavigation.columnWidths = new int[] {70, 50, 70, 0};
		gbl_customerNavigation.rowHeights = new int[] {70, 70, 70, 0};
		gbl_customerNavigation.columnWeights = new double[]{1.0, 0.0, 1.0, Double.MIN_VALUE};
		gbl_customerNavigation.rowWeights = new double[]{1.0, 1.0, 1.0, Double.MIN_VALUE};
		customerNavigation.setLayout(gbl_customerNavigation);
		
		JPanel searchProduct = new JPanel();
		searchProduct.setBackground(Color.GRAY);
		searchProduct.addMouseListener(setHoverEffect(searchProduct));
		GridBagConstraints gbc_searchProduct = new GridBagConstraints();
		gbc_searchProduct.gridwidth = 3;
		gbc_searchProduct.insets = new Insets(0, 0, 5, 0);
		gbc_searchProduct.fill = GridBagConstraints.BOTH;
		gbc_searchProduct.gridx = 0;
		gbc_searchProduct.gridy = 0;
		customerNavigation.add(searchProduct, gbc_searchProduct);
		GridBagLayout gbl_searchProduct = new GridBagLayout();
		gbl_searchProduct.columnWidths = new int[]{88, 206, 0, 0, 0};
		gbl_searchProduct.rowHeights = new int[]{0, 39, 0, 0, 0, 0};
		gbl_searchProduct.columnWeights = new double[]{0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
		gbl_searchProduct.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
		searchProduct.setLayout(gbl_searchProduct);
		
		JLabel lblSearchProduct = new JLabel("Search Product(s)");
		lblSearchProduct.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblSearchProduct.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblSearchProduct = new GridBagConstraints();
		gbc_lblSearchProduct.anchor = GridBagConstraints.WEST;
		gbc_lblSearchProduct.gridwidth = 2;
		gbc_lblSearchProduct.insets = new Insets(5, 5, 5, 5);
		gbc_lblSearchProduct.gridx = 0;
		gbc_lblSearchProduct.gridy = 0;
		searchProduct.add(lblSearchProduct, gbc_lblSearchProduct);
		
		JLabel lblKeywords = new JLabel("keywords:");
		lblKeywords.setForeground(Color.BLACK);
		GridBagConstraints gbc_lblKeywords = new GridBagConstraints();
		gbc_lblKeywords.insets = new Insets(0, 0, 5, 5);
		gbc_lblKeywords.anchor = GridBagConstraints.EAST;
		gbc_lblKeywords.gridx = 0;
		gbc_lblKeywords.gridy = 2;
		searchProduct.add(lblKeywords, gbc_lblKeywords);
		
		txtKeywords = new JTextField();
		txtKeywords.addMouseListener(setHoverEffect(searchProduct));
		txtKeywords.getDocument().addDocumentListener(new DocumentListener(){

			@Override
			public void changedUpdate(DocumentEvent arg0) {
				checkDocument();
			}

			@Override
			public void insertUpdate(DocumentEvent arg0) {
				checkDocument();
			}

			@Override
			public void removeUpdate(DocumentEvent arg0) {
				checkDocument();
			}
			
			public void checkDocument(){
				if(txtKeywords.getText().isEmpty() || txtKeywords.getText().replace(" ", "").isEmpty())
					btnSearch.setEnabled(false);
				else
					btnSearch.setEnabled(true);
			}
			
		});
		GridBagConstraints gbc_txtKeywords = new GridBagConstraints();
		gbc_txtKeywords.insets = new Insets(0, 0, 5, 5);
		gbc_txtKeywords.fill = GridBagConstraints.HORIZONTAL;
		gbc_txtKeywords.gridx = 1;
		gbc_txtKeywords.gridy = 2;
		searchProduct.add(txtKeywords, gbc_txtKeywords);
		txtKeywords.setColumns(10);
		
		btnSearch = new JButton("Search");
		btnSearch.setEnabled(false);
		btnSearch.addMouseListener(setHoverEffect(searchProduct));
		btnSearch.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String title = "Search";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
					spsf.search();
				}
				else{
					spsf = new Shop_Product_Search_Form(frame);
					tabs.add(title, spsf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}
		});
		
		JLabel label = new JLabel("?");
		label.addMouseListener(setHoverEffect(searchProduct));
		label.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				JOptionPane.showMessageDialog(frame, "Enter keywords separated by a space, \" \".\nResult(s) returned will meet minimum 1 keyword.", "Search Help", JOptionPane.INFORMATION_MESSAGE);
			}
		});
		label.setFont(new Font("Tahoma", Font.BOLD, 12));
		label.setForeground(Color.DARK_GRAY);
		label.setOpaque(true);
		label.setBackground(SystemColor.inactiveCaptionBorder);
		label.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		GridBagConstraints gbc_label = new GridBagConstraints();
		gbc_label.insets = new Insets(0, 0, 5, 5);
		gbc_label.gridx = 2;
		gbc_label.gridy = 2;
		searchProduct.add(label, gbc_label);
		GridBagConstraints gbc_btnSearch = new GridBagConstraints();
		gbc_btnSearch.insets = new Insets(0, 0, 5, 5);
		gbc_btnSearch.anchor = GridBagConstraints.WEST;
		gbc_btnSearch.gridx = 1;
		gbc_btnSearch.gridy = 3;
		searchProduct.add(btnSearch, gbc_btnSearch);
		
		JPanel catalogs = new JPanel();
		catalogs.setBackground(Color.GRAY);
		catalogs.addMouseListener(setHoverEffect(catalogs));
		catalogs.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Catalogs";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_Product_Form spf = new Shop_Product_Form(frame);
					tabs.add(title, spf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_catalogs = new GridBagConstraints();
		gbc_catalogs.gridwidth = 2;
		gbc_catalogs.insets = new Insets(0, 0, 5, 5);
		gbc_catalogs.fill = GridBagConstraints.BOTH;
		gbc_catalogs.gridx = 0;
		gbc_catalogs.gridy = 1;
		customerNavigation.add(catalogs, gbc_catalogs);
		GridBagLayout gbl_catalogs = new GridBagLayout();
		gbl_catalogs.columnWidths = new int[]{95, 42, 0};
		gbl_catalogs.rowHeights = new int[]{14, 0, 0};
		gbl_catalogs.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_catalogs.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		catalogs.setLayout(gbl_catalogs);
		
		JLabel lblCatalogs = new JLabel("Catalogs");
		lblCatalogs.setForeground(Color.DARK_GRAY);
		lblCatalogs.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblCatalogs = new GridBagConstraints();
		gbc_lblCatalogs.insets = new Insets(5, 5, 5, 5);
		gbc_lblCatalogs.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblCatalogs.gridx = 0;
		gbc_lblCatalogs.gridy = 0;
		catalogs.add(lblCatalogs, gbc_lblCatalogs);
		
		JLabel catalogImg = new JLabel("");
		catalogImg.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/catalog-icon.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_catalogImg = new GridBagConstraints();
		gbc_catalogImg.gridwidth = 2;
		gbc_catalogImg.gridx = 0;
		gbc_catalogImg.gridy = 1;
		catalogs.add(catalogImg, gbc_catalogImg);
		
		JPanel shoppingCart = new JPanel();
		shoppingCart.setBackground(Color.GRAY);
		shoppingCart.addMouseListener(setHoverEffect(shoppingCart));
		shoppingCart.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Shopping Cart";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_Order_Form sof = new Shop_Order_Form(frame);
					tabs.add(title, sof);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_shoppingCart = new GridBagConstraints();
		gbc_shoppingCart.insets = new Insets(0, 0, 5, 0);
		gbc_shoppingCart.fill = GridBagConstraints.BOTH;
		gbc_shoppingCart.gridx = 2;
		gbc_shoppingCart.gridy = 1;
		customerNavigation.add(shoppingCart, gbc_shoppingCart);
		GridBagLayout gbl_shoppingCart = new GridBagLayout();
		gbl_shoppingCart.columnWidths = new int[]{0, 0, 0};
		gbl_shoppingCart.rowHeights = new int[]{0, 0, 0};
		gbl_shoppingCart.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_shoppingCart.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		shoppingCart.setLayout(gbl_shoppingCart);
		
		JLabel lblShoppingCart = new JLabel("Shopping Cart");
		lblShoppingCart.setForeground(Color.DARK_GRAY);
		lblShoppingCart.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblShoppingCart = new GridBagConstraints();
		gbc_lblShoppingCart.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblShoppingCart.insets = new Insets(5, 5, 0, 0);
		gbc_lblShoppingCart.gridx = 0;
		gbc_lblShoppingCart.gridy = 0;
		shoppingCart.add(lblShoppingCart, gbc_lblShoppingCart);
		
		JLabel lblCartImg = new JLabel("");
		lblCartImg.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/shopping_cart.png").getScaledInstance(120, 120, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_lblCartImg = new GridBagConstraints();
		gbc_lblCartImg.gridwidth = 2;
		gbc_lblCartImg.gridx = 0;
		gbc_lblCartImg.gridy = 1;
		shoppingCart.add(lblCartImg, gbc_lblCartImg);
		
		JPanel orderHistory = new JPanel();
		orderHistory.setBackground(Color.GRAY);
		orderHistory.addMouseListener(setHoverEffect(orderHistory));
		orderHistory.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Order History";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_OrderHistory_Form sohf = new Shop_OrderHistory_Form(frame);
					tabs.add(title, sohf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_orderHistory = new GridBagConstraints();
		gbc_orderHistory.insets = new Insets(0, 0, 0, 5);
		gbc_orderHistory.fill = GridBagConstraints.BOTH;
		gbc_orderHistory.gridx = 0;
		gbc_orderHistory.gridy = 2;
		customerNavigation.add(orderHistory, gbc_orderHistory);
		GridBagLayout gbl_orderHistory = new GridBagLayout();
		gbl_orderHistory.columnWidths = new int[]{0, 0, 0};
		gbl_orderHistory.rowHeights = new int[]{0, 26, 0};
		gbl_orderHistory.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_orderHistory.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		orderHistory.setLayout(gbl_orderHistory);
		
		JLabel lblOrderHistory = new JLabel("Order History");
		lblOrderHistory.setForeground(Color.DARK_GRAY);
		lblOrderHistory.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblOrderHistory = new GridBagConstraints();
		gbc_lblOrderHistory.insets = new Insets(5, 5, 5, 5);
		gbc_lblOrderHistory.gridx = 0;
		gbc_lblOrderHistory.gridy = 0;
		orderHistory.add(lblOrderHistory, gbc_lblOrderHistory);
		
		JLabel orderHistoryImage = new JLabel("");
		orderHistoryImage.setHorizontalAlignment(SwingConstants.CENTER);
		orderHistoryImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/order.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_orderHistoryImage = new GridBagConstraints();
		gbc_orderHistoryImage.gridwidth = 2;
		gbc_orderHistoryImage.insets = new Insets(0, 0, 0, 5);
		gbc_orderHistoryImage.gridx = 0;
		gbc_orderHistoryImage.gridy = 1;
		orderHistory.add(orderHistoryImage, gbc_orderHistoryImage);
		
		JPanel profile = new JPanel();
		profile.setBackground(Color.GRAY);
		profile.addMouseListener(setHoverEffect(profile));
		profile.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Profile";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Customer_UpdateCustomerProfile cucp = new Customer_UpdateCustomerProfile(CommonControls.getUser());
					tabs.add(title, cucp);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_profile = new GridBagConstraints();
		gbc_profile.gridwidth = 2;
		gbc_profile.fill = GridBagConstraints.BOTH;
		gbc_profile.gridx = 1;
		gbc_profile.gridy = 2;
		customerNavigation.add(profile, gbc_profile);
		GridBagLayout gbl_profile = new GridBagLayout();
		gbl_profile.columnWidths = new int[]{0, 0, 0};
		gbl_profile.rowHeights = new int[]{0, 29, 0};
		gbl_profile.columnWeights = new double[]{1.0, 1.0, Double.MIN_VALUE};
		gbl_profile.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		profile.setLayout(gbl_profile);
		
		JLabel lblProfile = new JLabel("Profile");
		lblProfile.setForeground(Color.DARK_GRAY);
		lblProfile.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblProfile = new GridBagConstraints();
		gbc_lblProfile.insets = new Insets(5, 5, 5, 5);
		gbc_lblProfile.gridx = 0;
		gbc_lblProfile.gridy = 0;
		profile.add(lblProfile, gbc_lblProfile);
		
		JLabel profileImage = new JLabel("");
		profileImage.setHorizontalAlignment(SwingConstants.CENTER);
		profileImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/profile.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_profileImage = new GridBagConstraints();
		gbc_profileImage.gridwidth = 2;
		gbc_profileImage.insets = new Insets(0, 0, 0, 5);
		gbc_profileImage.gridx = 0;
		gbc_profileImage.gridy = 1;
		profile.add(profileImage, gbc_profileImage);
		
		JPanel staffNavigation = new JPanel();
		navigations.add(staffNavigation, "STAFF_NAVIGATION");
		GridBagLayout gbl_staffNavigation = new GridBagLayout();
		gbl_staffNavigation.columnWidths = new int[] {70, 50, 70, 0};
		gbl_staffNavigation.rowHeights = new int[] {70, 70, 70, 70, 70, 70, 0};
		gbl_staffNavigation.columnWeights = new double[]{1.0, 1.0, 1.0, Double.MIN_VALUE};
		gbl_staffNavigation.rowWeights = new double[]{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, Double.MIN_VALUE};
		staffNavigation.setLayout(gbl_staffNavigation);
		
		JPanel administrateWorkshop = new JPanel();
		administrateWorkshop.setBackground(Color.GRAY);
		administrateWorkshop.addMouseListener(setHoverEffect(administrateWorkshop));
		administrateWorkshop.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Workshops";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_WorkshopMain_Form wwmf = new Workshop_WorkshopMain_Form(frame);
					tabs.add(title, wwmf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_administrateWorkshop = new GridBagConstraints();
		gbc_administrateWorkshop.gridwidth = 2;
		gbc_administrateWorkshop.insets = new Insets(0, 0, 5, 5);
		gbc_administrateWorkshop.fill = GridBagConstraints.BOTH;
		gbc_administrateWorkshop.gridx = 0;
		gbc_administrateWorkshop.gridy = 0;
		staffNavigation.add(administrateWorkshop, gbc_administrateWorkshop);
		GridBagLayout gbl_administrateWorkshop = new GridBagLayout();
		gbl_administrateWorkshop.columnWidths = new int[]{0, 0, 0};
		gbl_administrateWorkshop.rowHeights = new int[]{0, 0, 0};
		gbl_administrateWorkshop.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_administrateWorkshop.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		administrateWorkshop.setLayout(gbl_administrateWorkshop);
		
		JLabel lblWorkshops_1 = new JLabel("Workshops");
		lblWorkshops_1.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblWorkshops_1.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblWorkshops_1 = new GridBagConstraints();
		gbc_lblWorkshops_1.insets = new Insets(5, 5, 5, 5);
		gbc_lblWorkshops_1.gridx = 0;
		gbc_lblWorkshops_1.gridy = 0;
		administrateWorkshop.add(lblWorkshops_1, gbc_lblWorkshops_1);
		
		JLabel workshopImage = new JLabel("");
		workshopImage.setHorizontalAlignment(SwingConstants.CENTER);
		workshopImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/workshop.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_workshopImage = new GridBagConstraints();
		gbc_workshopImage.gridwidth = 2;
		gbc_workshopImage.insets = new Insets(0, 0, 0, 5);
		gbc_workshopImage.gridx = 0;
		gbc_workshopImage.gridy = 1;
		administrateWorkshop.add(workshopImage, gbc_workshopImage);
		
		JPanel administrateBooking = new JPanel();
		administrateBooking.setBackground(Color.GRAY);
		administrateBooking.addMouseListener(setHoverEffect(administrateBooking));
		administrateBooking.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Bookings";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_ViewBooking_Form wvbf = new Workshop_ViewBooking_Form(frame);
					tabs.add(title, wvbf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
		
		});
		GridBagConstraints gbc_administrateBooking = new GridBagConstraints();
		gbc_administrateBooking.insets = new Insets(0, 0, 5, 0);
		gbc_administrateBooking.fill = GridBagConstraints.BOTH;
		gbc_administrateBooking.gridx = 2;
		gbc_administrateBooking.gridy = 0;
		staffNavigation.add(administrateBooking, gbc_administrateBooking);
		GridBagLayout gbl_administrateBooking = new GridBagLayout();
		gbl_administrateBooking.columnWidths = new int[]{0, 0, 0};
		gbl_administrateBooking.rowHeights = new int[]{0, 0, 0};
		gbl_administrateBooking.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_administrateBooking.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		administrateBooking.setLayout(gbl_administrateBooking);
		
		JLabel lblBookings = new JLabel("Bookings");
		lblBookings.setForeground(Color.DARK_GRAY);
		lblBookings.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblBookings = new GridBagConstraints();
		gbc_lblBookings.insets = new Insets(5, 5, 5, 5);
		gbc_lblBookings.gridx = 0;
		gbc_lblBookings.gridy = 0;
		administrateBooking.add(lblBookings, gbc_lblBookings);
		
		JLabel bookingImage = new JLabel("");
		bookingImage.setHorizontalAlignment(SwingConstants.CENTER);
		bookingImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/booking.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_bookingImage = new GridBagConstraints();
		gbc_bookingImage.gridwidth = 2;
		gbc_bookingImage.insets = new Insets(0, 0, 0, 5);
		gbc_bookingImage.gridx = 0;
		gbc_bookingImage.gridy = 1;
		administrateBooking.add(bookingImage, gbc_bookingImage);
		
		JPanel administrateOrders = new JPanel();
		administrateOrders.setBackground(Color.GRAY);
		administrateOrders.addMouseListener(setHoverEffect(administrateOrders));
		administrateOrders.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Orders";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_AdministrateOrders_Form saof = new Shop_AdministrateOrders_Form(frame);
					tabs.add(title, saof);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		JPanel administrateReport = new JPanel();
		administrateReport.setBackground(Color.GRAY);
		administrateReport.addMouseListener(setHoverEffect(administrateReport));
		administrateReport.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Report";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_Report_Form wrf = new Workshop_Report_Form(frame);
					tabs.add(title, wrf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_administrateReport = new GridBagConstraints();
		gbc_administrateReport.gridwidth = 3;
		gbc_administrateReport.insets = new Insets(0, 0, 5, 0);
		gbc_administrateReport.fill = GridBagConstraints.BOTH;
		gbc_administrateReport.gridx = 0;
		gbc_administrateReport.gridy = 1;
		staffNavigation.add(administrateReport, gbc_administrateReport);
		GridBagLayout gbl_administrateReport = new GridBagLayout();
		gbl_administrateReport.columnWidths = new int[]{0, 0, 0};
		gbl_administrateReport.rowHeights = new int[]{0, 0, 0};
		gbl_administrateReport.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_administrateReport.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		administrateReport.setLayout(gbl_administrateReport);
		
		JLabel lblReport = new JLabel("Report");
		lblReport.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblReport.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblReport = new GridBagConstraints();
		gbc_lblReport.insets = new Insets(5, 5, 5, 5);
		gbc_lblReport.gridx = 0;
		gbc_lblReport.gridy = 0;
		administrateReport.add(lblReport, gbc_lblReport);
		
		JLabel reportImage = new JLabel("");
		reportImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/report.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		reportImage.setHorizontalAlignment(SwingConstants.CENTER);
		GridBagConstraints gbc_reportImage = new GridBagConstraints();
		gbc_reportImage.gridwidth = 2;
		gbc_reportImage.insets = new Insets(0, 0, 0, 5);
		gbc_reportImage.gridx = 0;
		gbc_reportImage.gridy = 1;
		administrateReport.add(reportImage, gbc_reportImage);
		GridBagConstraints gbc_administrateOrders = new GridBagConstraints();
		gbc_administrateOrders.insets = new Insets(0, 0, 5, 5);
		gbc_administrateOrders.fill = GridBagConstraints.BOTH;
		gbc_administrateOrders.gridx = 0;
		gbc_administrateOrders.gridy = 2;
		staffNavigation.add(administrateOrders, gbc_administrateOrders);
		GridBagLayout gbl_administrateOrders = new GridBagLayout();
		gbl_administrateOrders.columnWidths = new int[]{0, 0, 0};
		gbl_administrateOrders.rowHeights = new int[]{0, 0, 0};
		gbl_administrateOrders.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_administrateOrders.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		administrateOrders.setLayout(gbl_administrateOrders);
		
		JLabel lblOrders = new JLabel("Orders");
		lblOrders.setForeground(Color.DARK_GRAY);
		lblOrders.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblOrders = new GridBagConstraints();
		gbc_lblOrders.insets = new Insets(5, 5, 5, 5);
		gbc_lblOrders.gridx = 0;
		gbc_lblOrders.gridy = 0;
		administrateOrders.add(lblOrders, gbc_lblOrders);
		
		JLabel orderImage = new JLabel("");
		orderImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/order.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_orderImage = new GridBagConstraints();
		gbc_orderImage.gridwidth = 2;
		gbc_orderImage.insets = new Insets(0, 0, 0, 5);
		gbc_orderImage.gridx = 0;
		gbc_orderImage.gridy = 1;
		administrateOrders.add(orderImage, gbc_orderImage);
		
		JPanel administrateProduct = new JPanel();
		administrateProduct.setBackground(Color.GRAY);
		administrateProduct.addMouseListener(setHoverEffect(administrateProduct));
		administrateProduct.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Products";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_Product_Administrate_Form spaf = new Shop_Product_Administrate_Form(frame);
					tabs.add(title, spaf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_administrateProduct = new GridBagConstraints();
		gbc_administrateProduct.gridwidth = 2;
		gbc_administrateProduct.insets = new Insets(0, 0, 5, 0);
		gbc_administrateProduct.fill = GridBagConstraints.BOTH;
		gbc_administrateProduct.gridx = 1;
		gbc_administrateProduct.gridy = 2;
		staffNavigation.add(administrateProduct, gbc_administrateProduct);
		GridBagLayout gbl_administrateProduct = new GridBagLayout();
		gbl_administrateProduct.columnWidths = new int[] {95, 42, 0};
		gbl_administrateProduct.rowHeights = new int[]{14, 0, 0};
		gbl_administrateProduct.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_administrateProduct.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		administrateProduct.setLayout(gbl_administrateProduct);
		
		JLabel lblAdministrateProduct = new JLabel("Products");
		lblAdministrateProduct.setForeground(Color.DARK_GRAY);
		lblAdministrateProduct.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblAdministrateProduct = new GridBagConstraints();
		gbc_lblAdministrateProduct.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblAdministrateProduct.insets = new Insets(5, 5, 5, 5);
		gbc_lblAdministrateProduct.gridx = 0;
		gbc_lblAdministrateProduct.gridy = 0;
		administrateProduct.add(lblAdministrateProduct, gbc_lblAdministrateProduct);
		
		JLabel lblAdministrateproductimg = new JLabel("");
		lblAdministrateproductimg.setHorizontalAlignment(SwingConstants.CENTER);
		lblAdministrateproductimg.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/product.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_lblAdministrateproductimg = new GridBagConstraints();
		gbc_lblAdministrateproductimg.fill = GridBagConstraints.BOTH;
		gbc_lblAdministrateproductimg.gridwidth = 2;
		gbc_lblAdministrateproductimg.insets = new Insets(0, 0, 0, 5);
		gbc_lblAdministrateproductimg.gridx = 0;
		gbc_lblAdministrateproductimg.gridy = 1;
		administrateProduct.add(lblAdministrateproductimg, gbc_lblAdministrateproductimg);
		
		JPanel createJob = new JPanel();
		createJob.setBackground(Color.GRAY);
		createJob.addMouseListener(setHoverEffect(createJob));
		createJob.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Create Job";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Job_RegistrationForm jrf = new Job_RegistrationForm();
					tabs.add(title, jrf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		JPanel viewJob = new JPanel();
		viewJob.setBackground(Color.GRAY);
		viewJob.addMouseListener(setHoverEffect(viewJob));
		viewJob.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "View Job";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Job_SearchForm jsf = new Job_SearchForm(frame);
					tabs.add(title, jsf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_viewJob = new GridBagConstraints();
		gbc_viewJob.gridwidth = 3;
		gbc_viewJob.insets = new Insets(0, 0, 5, 0);
		gbc_viewJob.fill = GridBagConstraints.BOTH;
		gbc_viewJob.gridx = 0;
		gbc_viewJob.gridy = 3;
		staffNavigation.add(viewJob, gbc_viewJob);
		GridBagLayout gbl_viewJob = new GridBagLayout();
		gbl_viewJob.columnWidths = new int[]{38, 42, 0};
		gbl_viewJob.rowHeights = new int[]{14, 0, 0};
		gbl_viewJob.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_viewJob.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		viewJob.setLayout(gbl_viewJob);
		
		JLabel lblViewJob = new JLabel("View Job");
		lblViewJob.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblViewJob.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblViewJob = new GridBagConstraints();
		gbc_lblViewJob.insets = new Insets(5, 5, 5, 5);
		gbc_lblViewJob.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblViewJob.gridx = 0;
		gbc_lblViewJob.gridy = 0;
		viewJob.add(lblViewJob, gbc_lblViewJob);
		
		JLabel jobImage = new JLabel("");
		jobImage.setHorizontalAlignment(SwingConstants.CENTER);
		jobImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/job.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_jobImage = new GridBagConstraints();
		gbc_jobImage.gridwidth = 2;
		gbc_jobImage.insets = new Insets(0, 0, 0, 5);
		gbc_jobImage.gridx = 0;
		gbc_jobImage.gridy = 1;
		viewJob.add(jobImage, gbc_jobImage);
		GridBagConstraints gbc_createJob = new GridBagConstraints();
		gbc_createJob.insets = new Insets(0, 0, 5, 5);
		gbc_createJob.fill = GridBagConstraints.BOTH;
		gbc_createJob.gridx = 0;
		gbc_createJob.gridy = 4;
		staffNavigation.add(createJob, gbc_createJob);
		GridBagLayout gbl_createJob = new GridBagLayout();
		gbl_createJob.columnWidths = new int[]{0, 0, 0};
		gbl_createJob.rowHeights = new int[]{0, 0, 0};
		gbl_createJob.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_createJob.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		createJob.setLayout(gbl_createJob);
		
		JLabel lblCreateJob = new JLabel("Create Job");
		lblCreateJob.setForeground(Color.DARK_GRAY);
		lblCreateJob.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblCreateJob = new GridBagConstraints();
		gbc_lblCreateJob.insets = new Insets(5, 5, 5, 5);
		gbc_lblCreateJob.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblCreateJob.gridx = 0;
		gbc_lblCreateJob.gridy = 0;
		createJob.add(lblCreateJob, gbc_lblCreateJob);
		
		JLabel cJobImage = new JLabel("");
		cJobImage.setHorizontalAlignment(SwingConstants.CENTER);
		cJobImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/job.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_cJobImage = new GridBagConstraints();
		gbc_cJobImage.gridwidth = 2;
		gbc_cJobImage.insets = new Insets(0, 0, 0, 5);
		gbc_cJobImage.gridx = 0;
		gbc_cJobImage.gridy = 1;
		createJob.add(cJobImage, gbc_cJobImage);
		
		JPanel updateJob = new JPanel();
		updateJob.setBackground(Color.GRAY);
		updateJob.addMouseListener(setHoverEffect(updateJob));
		updateJob.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Update Job";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Job_UpdateForm juf = new Job_UpdateForm(frame);
					tabs.add(title, juf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		updateJob.addMouseListener(setHoverEffect(updateJob));
		GridBagConstraints gbc_updateJob = new GridBagConstraints();
		gbc_updateJob.insets = new Insets(0, 0, 5, 5);
		gbc_updateJob.fill = GridBagConstraints.BOTH;
		gbc_updateJob.gridx = 1;
		gbc_updateJob.gridy = 4;
		staffNavigation.add(updateJob, gbc_updateJob);
		GridBagLayout gbl_updateJob = new GridBagLayout();
		gbl_updateJob.columnWidths = new int[]{0, 0, 0};
		gbl_updateJob.rowHeights = new int[]{0, 0, 0};
		gbl_updateJob.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_updateJob.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		updateJob.setLayout(gbl_updateJob);
		
		JLabel lblUpdateJob = new JLabel("Update Job");
		lblUpdateJob.setForeground(Color.DARK_GRAY);
		lblUpdateJob.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblUpdateJob = new GridBagConstraints();
		gbc_lblUpdateJob.insets = new Insets(5, 5, 5, 5);
		gbc_lblUpdateJob.anchor = GridBagConstraints.NORTHWEST;
		gbc_lblUpdateJob.gridx = 0;
		gbc_lblUpdateJob.gridy = 0;
		updateJob.add(lblUpdateJob, gbc_lblUpdateJob);
		
		JLabel uJobImage = new JLabel("");
		uJobImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/job.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		uJobImage.setHorizontalAlignment(SwingConstants.CENTER);
		GridBagConstraints gbc_uJobImage = new GridBagConstraints();
		gbc_uJobImage.gridwidth = 2;
		gbc_uJobImage.insets = new Insets(0, 0, 0, 5);
		gbc_uJobImage.gridx = 0;
		gbc_uJobImage.gridy = 1;
		updateJob.add(uJobImage, gbc_uJobImage);
		
		JPanel deleteJob = new JPanel();
		deleteJob.setBackground(Color.GRAY);
		deleteJob.addMouseListener(setHoverEffect(deleteJob));
		deleteJob.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Delete Job";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Job_DeleteForm jdf = new Job_DeleteForm();
					tabs.add(title, jdf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_deleteJob = new GridBagConstraints();
		gbc_deleteJob.insets = new Insets(0, 0, 5, 0);
		gbc_deleteJob.fill = GridBagConstraints.BOTH;
		gbc_deleteJob.gridx = 2;
		gbc_deleteJob.gridy = 4;
		staffNavigation.add(deleteJob, gbc_deleteJob);
		GridBagLayout gbl_deleteJob = new GridBagLayout();
		gbl_deleteJob.columnWidths = new int[]{0, 0, 0};
		gbl_deleteJob.rowHeights = new int[]{0, 0, 0};
		gbl_deleteJob.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_deleteJob.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		deleteJob.setLayout(gbl_deleteJob);
		
		JLabel lblDeleteJob = new JLabel("Delete Job");
		lblDeleteJob.setForeground(Color.DARK_GRAY);
		lblDeleteJob.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblDeleteJob = new GridBagConstraints();
		gbc_lblDeleteJob.insets = new Insets(5, 5, 5, 5);
		gbc_lblDeleteJob.gridx = 0;
		gbc_lblDeleteJob.gridy = 0;
		deleteJob.add(lblDeleteJob, gbc_lblDeleteJob);
		
		JLabel dJobImage = new JLabel("");
		dJobImage.setHorizontalAlignment(SwingConstants.CENTER);
		dJobImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/job.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_dJobImage = new GridBagConstraints();
		gbc_dJobImage.gridwidth = 2;
		gbc_dJobImage.insets = new Insets(0, 0, 0, 5);
		gbc_dJobImage.gridx = 0;
		gbc_dJobImage.gridy = 1;
		deleteJob.add(dJobImage, gbc_dJobImage);
		
		JPanel createNeedy = new JPanel();
		createNeedy.setBackground(Color.GRAY);
		createNeedy.addMouseListener(setHoverEffect(createNeedy));
		createNeedy.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Create Needy Account";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					NeedyResident_CreateUser_Form nrcuf = new NeedyResident_CreateUser_Form();
					tabs.add(title, nrcuf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_createNeedy = new GridBagConstraints();
		gbc_createNeedy.gridwidth = 2;
		gbc_createNeedy.insets = new Insets(0, 0, 0, 5);
		gbc_createNeedy.fill = GridBagConstraints.BOTH;
		gbc_createNeedy.gridx = 0;
		gbc_createNeedy.gridy = 5;
		staffNavigation.add(createNeedy, gbc_createNeedy);
		GridBagLayout gbl_createNeedy = new GridBagLayout();
		gbl_createNeedy.columnWidths = new int[]{0, 0, 0};
		gbl_createNeedy.rowHeights = new int[]{0, 0, 0};
		gbl_createNeedy.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_createNeedy.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		createNeedy.setLayout(gbl_createNeedy);
		
		JLabel lblNeedyResident = new JLabel("Create Needy Account");
		lblNeedyResident.setForeground(Color.DARK_GRAY);
		lblNeedyResident.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblNeedyResident = new GridBagConstraints();
		gbc_lblNeedyResident.insets = new Insets(5, 5, 5, 5);
		gbc_lblNeedyResident.gridx = 0;
		gbc_lblNeedyResident.gridy = 0;
		createNeedy.add(lblNeedyResident, gbc_lblNeedyResident);
		
		JLabel createNeedyImage = new JLabel("");
		createNeedyImage.setHorizontalAlignment(SwingConstants.CENTER);
		createNeedyImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/add_user.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_createNeedyImage = new GridBagConstraints();
		gbc_createNeedyImage.gridwidth = 2;
		gbc_createNeedyImage.insets = new Insets(0, 0, 0, 5);
		gbc_createNeedyImage.gridx = 0;
		gbc_createNeedyImage.gridy = 1;
		createNeedy.add(createNeedyImage, gbc_createNeedyImage);
		
		JPanel activateNeedy = new JPanel();
		activateNeedy.setBackground(Color.GRAY);
		activateNeedy.addMouseListener(setHoverEffect(activateNeedy));
		activateNeedy.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Delete Needy Account";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					NeedyResident_ActivateUser_Form nrauf = new NeedyResident_ActivateUser_Form();
					tabs.add(title, nrauf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_activateNeedy = new GridBagConstraints();
		gbc_activateNeedy.fill = GridBagConstraints.BOTH;
		gbc_activateNeedy.gridx = 2;
		gbc_activateNeedy.gridy = 5;
		staffNavigation.add(activateNeedy, gbc_activateNeedy);
		GridBagLayout gbl_activateNeedy = new GridBagLayout();
		gbl_activateNeedy.columnWidths = new int[]{0, 0, 0};
		gbl_activateNeedy.rowHeights = new int[]{0, 0, 0};
		gbl_activateNeedy.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_activateNeedy.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
		activateNeedy.setLayout(gbl_activateNeedy);
		
		JLabel lblActivateNeedy = new JLabel("Activate Needy Account");
		lblActivateNeedy.setForeground(Color.DARK_GRAY);
		lblActivateNeedy.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblActivateNeedy = new GridBagConstraints();
		gbc_lblActivateNeedy.insets = new Insets(5, 5, 5, 5);
		gbc_lblActivateNeedy.gridx = 0;
		gbc_lblActivateNeedy.gridy = 0;
		activateNeedy.add(lblActivateNeedy, gbc_lblActivateNeedy);
		
		JLabel activateNeedyImage = new JLabel("");
		activateNeedyImage.setHorizontalAlignment(SwingConstants.CENTER);
		activateNeedyImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/activate.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_activateNeedyImage = new GridBagConstraints();
		gbc_activateNeedyImage.gridwidth = 2;
		gbc_activateNeedyImage.insets = new Insets(0, 0, 0, 5);
		gbc_activateNeedyImage.gridx = 0;
		gbc_activateNeedyImage.gridy = 1;
		activateNeedy.add(activateNeedyImage, gbc_activateNeedyImage);
		
		JPanel needyNavigation = new JPanel();
		navigations.add(needyNavigation, "NEEDY_NAVIGATION");
		GridBagLayout gbl_needyNavigation = new GridBagLayout();
		gbl_needyNavigation.columnWidths = new int[] {70, 50, 70, 0};
		gbl_needyNavigation.rowHeights = new int[] {0, 0, 0, 0, 0};
		gbl_needyNavigation.columnWeights = new double[]{1.0, 0.0, 1.0, Double.MIN_VALUE};
		gbl_needyNavigation.rowWeights = new double[]{1.0, 1.0, 1.0, 1.0, Double.MIN_VALUE};
		needyNavigation.setLayout(gbl_needyNavigation);
		
		JPanel workshop = new JPanel();
		workshop.setBackground(Color.GRAY);
		workshop.addMouseListener(setHoverEffect(workshop));
		workshop.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Workshops";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_WorkshopMain_Form wwmf = new Workshop_WorkshopMain_Form(frame);
					tabs.add(title, wwmf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_workshop = new GridBagConstraints();
		gbc_workshop.gridwidth = 2;
		gbc_workshop.insets = new Insets(0, 0, 5, 5);
		gbc_workshop.fill = GridBagConstraints.BOTH;
		gbc_workshop.gridx = 0;
		gbc_workshop.gridy = 0;
		needyNavigation.add(workshop, gbc_workshop);
		GridBagLayout gbl_workshop = new GridBagLayout();
		gbl_workshop.columnWidths = new int[]{0, 0, 0};
		gbl_workshop.rowHeights = new int[]{0, 10, 0};
		gbl_workshop.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_workshop.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		workshop.setLayout(gbl_workshop);
		
		JLabel lblWorkshops = new JLabel("Workshops");
		lblWorkshops.setForeground(Color.DARK_GRAY);
		lblWorkshops.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblWorkshops = new GridBagConstraints();
		gbc_lblWorkshops.insets = new Insets(5, 5, 5, 5);
		gbc_lblWorkshops.gridx = 0;
		gbc_lblWorkshops.gridy = 0;
		workshop.add(lblWorkshops, gbc_lblWorkshops);
		
		JLabel workshopsImage = new JLabel("");
		workshopsImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/workshop.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_workshopsImage = new GridBagConstraints();
		gbc_workshopsImage.gridwidth = 2;
		gbc_workshopsImage.insets = new Insets(0, 0, 0, 5);
		gbc_workshopsImage.gridx = 0;
		gbc_workshopsImage.gridy = 1;
		workshop.add(workshopsImage, gbc_workshopsImage);
		
		JPanel jobs = new JPanel();
		jobs.setBackground(Color.GRAY);
		jobs.addMouseListener(setHoverEffect(jobs));
		jobs.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Jobs";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Job_SearchForm jsf = new Job_SearchForm(frame);
					tabs.add(title, jsf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		
		JPanel bookings = new JPanel();
		bookings.setBackground(Color.GRAY);
		bookings.addMouseListener(setHoverEffect(bookings));
		bookings.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Bookings";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_ViewBooking_Form wvbf = new Workshop_ViewBooking_Form(frame);
					tabs.add(title, wvbf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_bookings = new GridBagConstraints();
		gbc_bookings.insets = new Insets(0, 0, 5, 0);
		gbc_bookings.fill = GridBagConstraints.BOTH;
		gbc_bookings.gridx = 2;
		gbc_bookings.gridy = 0;
		needyNavigation.add(bookings, gbc_bookings);
		GridBagLayout gbl_bookings = new GridBagLayout();
		gbl_bookings.columnWidths = new int[]{0, 0, 0};
		gbl_bookings.rowHeights = new int[]{0, 11, 0};
		gbl_bookings.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_bookings.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		bookings.setLayout(gbl_bookings);
		
		JLabel lblBookings_1 = new JLabel("Bookings");
		lblBookings_1.setForeground(Color.DARK_GRAY);
		lblBookings_1.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblBookings_1 = new GridBagConstraints();
		gbc_lblBookings_1.insets = new Insets(5, 5, 5, 5);
		gbc_lblBookings_1.gridx = 0;
		gbc_lblBookings_1.gridy = 0;
		bookings.add(lblBookings_1, gbc_lblBookings_1);
		
		JLabel bookingsImage = new JLabel("");
		bookingsImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/booking.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_bookingsImage = new GridBagConstraints();
		gbc_bookingsImage.gridwidth = 2;
		gbc_bookingsImage.insets = new Insets(0, 0, 0, 5);
		gbc_bookingsImage.gridx = 0;
		gbc_bookingsImage.gridy = 1;
		bookings.add(bookingsImage, gbc_bookingsImage);
		
		JPanel report = new JPanel();
		report.setBackground(Color.GRAY);
		report.addMouseListener(setHoverEffect(report));
		report.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Report";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Workshop_Report_Form wrf = new Workshop_Report_Form(frame);
					tabs.add(title, wrf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_report = new GridBagConstraints();
		gbc_report.gridwidth = 3;
		gbc_report.insets = new Insets(0, 0, 5, 0);
		gbc_report.fill = GridBagConstraints.BOTH;
		gbc_report.gridx = 0;
		gbc_report.gridy = 1;
		needyNavigation.add(report, gbc_report);
		GridBagLayout gbl_report = new GridBagLayout();
		gbl_report.columnWidths = new int[]{0, 0, 0};
		gbl_report.rowHeights = new int[]{0, 18, 0};
		gbl_report.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_report.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		report.setLayout(gbl_report);
		
		JLabel lblReport_1 = new JLabel("Report");
		lblReport_1.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblReport_1.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblReport_1 = new GridBagConstraints();
		gbc_lblReport_1.insets = new Insets(5, 5, 5, 5);
		gbc_lblReport_1.gridx = 0;
		gbc_lblReport_1.gridy = 0;
		report.add(lblReport_1, gbc_lblReport_1);
		
		JLabel report2Image = new JLabel("");
		report2Image.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/report.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_report2Image = new GridBagConstraints();
		gbc_report2Image.gridwidth = 2;
		gbc_report2Image.insets = new Insets(0, 0, 0, 5);
		gbc_report2Image.gridx = 0;
		gbc_report2Image.gridy = 1;
		report.add(report2Image, gbc_report2Image);
		
		JPanel orders = new JPanel();
		orders.setBackground(Color.GRAY);
		orders.addMouseListener(setHoverEffect(orders));
		orders.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				String title = "Orders";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					Shop_AcceptOrder_Form saof = new Shop_AcceptOrder_Form(frame);
					tabs.add(title, saof);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_orders = new GridBagConstraints();
		gbc_orders.insets = new Insets(0, 0, 5, 5);
		gbc_orders.fill = GridBagConstraints.BOTH;
		gbc_orders.gridx = 0;
		gbc_orders.gridy = 2;
		needyNavigation.add(orders, gbc_orders);
		GridBagLayout gbl_orders = new GridBagLayout();
		gbl_orders.columnWidths = new int[]{0, 0, 0};
		gbl_orders.rowHeights = new int[]{0, 15, 0};
		gbl_orders.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_orders.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		orders.setLayout(gbl_orders);
		
		JLabel lblOrders_1 = new JLabel("Orders");
		lblOrders_1.setForeground(Color.DARK_GRAY);
		lblOrders_1.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lblOrders_1 = new GridBagConstraints();
		gbc_lblOrders_1.insets = new Insets(5, 5, 5, 5);
		gbc_lblOrders_1.gridx = 0;
		gbc_lblOrders_1.gridy = 0;
		orders.add(lblOrders_1, gbc_lblOrders_1);
		
		JLabel ordersImage = new JLabel("");
		ordersImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/order.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_ordersImage = new GridBagConstraints();
		gbc_ordersImage.gridwidth = 2;
		gbc_ordersImage.insets = new Insets(0, 0, 0, 5);
		gbc_ordersImage.gridx = 0;
		gbc_ordersImage.gridy = 1;
		orders.add(ordersImage, gbc_ordersImage);
		GridBagConstraints gbc_jobs = new GridBagConstraints();
		gbc_jobs.gridwidth = 2;
		gbc_jobs.insets = new Insets(0, 0, 5, 0);
		gbc_jobs.fill = GridBagConstraints.BOTH;
		gbc_jobs.gridx = 1;
		gbc_jobs.gridy = 2;
		needyNavigation.add(jobs, gbc_jobs);
		GridBagLayout gbl_jobs = new GridBagLayout();
		gbl_jobs.columnWidths = new int[]{0, 0, 0};
		gbl_jobs.rowHeights = new int[]{0, 15, 0};
		gbl_jobs.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_jobs.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		jobs.setLayout(gbl_jobs);
		
		JLabel lblJobs = new JLabel("Jobs");
		lblJobs.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblJobs.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblJobs = new GridBagConstraints();
		gbc_lblJobs.insets = new Insets(5, 5, 5, 5);
		gbc_lblJobs.gridx = 0;
		gbc_lblJobs.gridy = 0;
		jobs.add(lblJobs, gbc_lblJobs);
		
		JLabel jobsImage = new JLabel("");
		jobsImage.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/job.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_jobsImage = new GridBagConstraints();
		gbc_jobsImage.gridwidth = 2;
		gbc_jobsImage.insets = new Insets(0, 0, 0, 5);
		gbc_jobsImage.gridx = 0;
		gbc_jobsImage.gridy = 1;
		jobs.add(jobsImage, gbc_jobsImage);
		
		JPanel updateNeedyProfile = new JPanel();
		updateNeedyProfile.setBackground(Color.GRAY);
		updateNeedyProfile.addMouseListener(setHoverEffect(updateNeedyProfile));
		updateNeedyProfile.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				String title = "Update Profile";
				if(tabs.indexOfTab(title) >= 0){
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
				else{
					NeedyResident_UpdateUser_Form nruuf = new NeedyResident_UpdateUser_Form();
					tabs.add(title, nruuf);
					
					int indexOfTab = tabs.indexOfTab(title);
					
					tabs.setTabComponentAt(indexOfTab, getCustomTab(title));
					tabs.setSelectedIndex(tabs.indexOfTab(title));
				}
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
		});
		GridBagConstraints gbc_updateNeedyProfile = new GridBagConstraints();
		gbc_updateNeedyProfile.gridwidth = 3;
		gbc_updateNeedyProfile.fill = GridBagConstraints.BOTH;
		gbc_updateNeedyProfile.gridx = 0;
		gbc_updateNeedyProfile.gridy = 3;
		needyNavigation.add(updateNeedyProfile, gbc_updateNeedyProfile);
		GridBagLayout gbl_updateNeedyProfile = new GridBagLayout();
		gbl_updateNeedyProfile.columnWidths = new int[]{0, 0, 0};
		gbl_updateNeedyProfile.rowHeights = new int[]{0, 12, 0};
		gbl_updateNeedyProfile.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gbl_updateNeedyProfile.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		updateNeedyProfile.setLayout(gbl_updateNeedyProfile);
		
		JLabel lblProfile_1 = new JLabel("Profile");
		lblProfile_1.setFont(new Font("Tahoma", Font.BOLD, 14));
		lblProfile_1.setForeground(Color.DARK_GRAY);
		GridBagConstraints gbc_lblProfile_1 = new GridBagConstraints();
		gbc_lblProfile_1.insets = new Insets(5, 5, 5, 5);
		gbc_lblProfile_1.gridx = 0;
		gbc_lblProfile_1.gridy = 0;
		updateNeedyProfile.add(lblProfile_1, gbc_lblProfile_1);
		
		JLabel profile2Image = new JLabel("");
		profile2Image.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/profile.png").getScaledInstance(70, 70, Image.SCALE_DEFAULT)));
		GridBagConstraints gbc_profile2Image = new GridBagConstraints();
		gbc_profile2Image.gridwidth = 2;
		gbc_profile2Image.insets = new Insets(0, 0, 0, 5);
		gbc_profile2Image.gridx = 0;
		gbc_profile2Image.gridy = 1;
		updateNeedyProfile.add(profile2Image, gbc_profile2Image);
		
		//Set selected card tab
		CardLayout card = (CardLayout)navigations.getLayout();
		
		progress = new JPanel();
		progress.setPreferredSize(new Dimension(200, 20));
		
		JSeparator separator_1 = new JSeparator();
		separator_1.setForeground(Color.LIGHT_GRAY);
		GridBagConstraints gbc_separator_1 = new GridBagConstraints();
		gbc_separator_1.fill = GridBagConstraints.BOTH;
		gbc_separator_1.gridwidth = 3;
		gbc_separator_1.insets = new Insets(0, 0, 5, 5);
		gbc_separator_1.gridx = 0;
		gbc_separator_1.gridy = 1;
		contentPane.add(separator_1, gbc_separator_1);
		FlowLayout fl_progress = (FlowLayout) progress.getLayout();
		fl_progress.setAlignment(FlowLayout.LEFT);
		GridBagConstraints gbc_progress = new GridBagConstraints();
		gbc_progress.insets = new Insets(0, 0, 5, 0);
		gbc_progress.gridwidth = 3;
		gbc_progress.anchor = GridBagConstraints.NORTHWEST;
		gbc_progress.fill = GridBagConstraints.BOTH;
		gbc_progress.gridx = 0;
		gbc_progress.gridy = 2;
		contentPane.add(progress, gbc_progress);
		
		lblLeaseWait = new JLabel("Complete");
		progress.add(lblLeaseWait);
		
		progressBar = new JProgressBar();
		progressBar.setVisible(false);
		progressBar.setIndeterminate(true);
		progress.add(progressBar);
		
		if(CommonControls.getUserType() == "Customer")
			card.show(navigations, "CUSTOMER_NAVIGATION");
		else if(CommonControls.getUserType() == "Needy")
			card.show(navigations, "NEEDY_NAVIGATION");
		else if(CommonControls.getUserType() == "Staff")
			card.show(navigations, "STAFF_NAVIGATION");
		
		JMenuBar menuBar = new JMenuBar();
		menuBar.setBorder(new MatteBorder(0, 0, 1, 0, (Color) new Color(192, 192, 192)));
		this.setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		JMenuItem mntmExit = new JMenuItem("Exit");
		mntmExit.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent arg0) {
				frame.dispose();
			}
			
		});
		mnFile.add(mntmExit);
		
		Component horizontalGlue = Box.createHorizontalGlue();
		menuBar.add(horizontalGlue);
		
		JMenu mnUser = new JMenu();
		mnUser.setText("Hi, " + CommonControls.getUser().getName());
		if(CommonControls.getUserType().equals("Customer"))
			mnUser.setText(mnUser.getText() + " (" + CommonControls.getUser().getCustomerUserType() + ")");
		mnUser.setForeground(Color.GRAY);
		mnUser.setEnabled(false);
		menuBar.add(mnUser);
		
		JMenu mnSignOut = new JMenu("Sign Out");
		mnSignOut.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				frame.dispose();
				
				JFrame frame = new JFrame();
				frame.setTitle("Login");
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
				JPanel contentPane = new JPanel();
				
				
				
				Customer_LogIn start = new Customer_LogIn(frame);
				contentPane.add(start);
				frame.setContentPane(contentPane);
				
				//Dynamically set size
				frame.pack();
				frame.setSize(frame.getWidth(), frame.getHeight());
				
				//Set frame to middle
				frame.setLocationRelativeTo(null);
				frame.setVisible(true);
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		});
		menuBar.add(mnSignOut);
	}
	
	//Adding custom close tab
	public JPanel getCustomTab(String title){
		JPanel customTab = new JPanel();
		customTab.setOpaque(false);
		customTab.setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.weightx = 1;
		gbc.ipadx = 5;
		JLabel titleLbl = new JLabel(title);
		titleLbl.setFont(new Font(null, Font.PLAIN, 15));
		customTab.add(titleLbl, gbc);

		gbc.gridx++;
		gbc.weightx = 0;
		final JLabel closeBtn = new JLabel("x");
		closeBtn.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 15));
		closeBtn.setForeground(Color.BLACK);
		closeBtn.addMouseListener(new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent e) {
				Component selected = tabs.getSelectedComponent();
		        if (selected != null) {

		            ((JLabel)e.getSource()).removeAll();
		            tabs.remove(selected);

		        }
			}

			@Override
			public void mouseEntered(MouseEvent e) {
				closeBtn.setForeground(Color.RED);
			}

			@Override
			public void mouseExited(MouseEvent e) {
				closeBtn.setForeground(Color.BLACK);
			}

			@Override
			public void mousePressed(MouseEvent e) {
				closeBtn.setForeground(Color.RED);
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				closeBtn.setForeground(Color.BLACK);
			}
			
		});
		customTab.add(closeBtn, gbc);
		
		return customTab;
	}
	
	public MouseListener setHoverEffect(final JPanel panel){
		return new MouseListener(){

			@Override
			public void mouseClicked(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
				panel.setBackground(Color.LIGHT_GRAY);
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
				panel.setBackground(Color.GRAY);
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
				// TODO Auto-generated method stub
				
			}
			
		};
	}

	public void displayMessage(boolean valid, String text){
		if(valid){
			JOptionPane.showMessageDialog(frame, text, "System Message", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/tick.png").getScaledInstance(30, 30, Image.SCALE_DEFAULT)));
		}
		else{
			JOptionPane.showMessageDialog(frame, text, "System Message", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(Toolkit.getDefaultToolkit().createImage("Resources/Images/Icons/cross.png").getScaledInstance(30, 30, Image.SCALE_DEFAULT)));
		}
	}
	public void getProgressBar() {
		if(progressBarCalls == 0){
			setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
			getLblLeaseWait().setText("Please wait...");
			frame.setEnabled(false);
			getProgressBar_1().setVisible(true);
		}
		progressBarCalls++;
	}
	
	public void closeProgressBar(){
		progressBarCalls--;
		if(progressBarCalls == 0){
			setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
			getLblLeaseWait().setText("Complete");
			frame.setEnabled(true);
			getProgressBar_1().setVisible(false);
		}
	}
	
	public JLabel getLblLeaseWait() {
		return lblLeaseWait;
	}
	public JProgressBar getProgressBar_1() {
		return progressBar;
	}
	public JTextField getTxtKeywords() {
		return txtKeywords;
	}
}
